﻿CREATE FUNCTION [dbo].[fn_GetUser]()
RETURNS [varchar](10) WITH EXECUTE AS CALLER
AS 
BEGIN
	DECLARE @cUser VARCHAR(10)
	SELECT  @cUser=rtrim(loginame) FROM master..sysprocesses WHERE spid = @@spid
	RETURN @cUser
END


